import { createRouter, createWebHashHistory } from "vue-router";
import HomeView from "../views/HomeView.vue";
import HeaderComp from "../components/HeaderComp.vue";
import FooterComp from "../components/FooterComp.vue";
import LoginView from "../views/LoginView.vue";
import UserCenterView from "../views/UserCenterView.vue";
import RegistView from "../views/RegistView.vue";
import RegistTwoComp from "../components/RegistComp/RegistTwoComp.vue";
import DetailView from "../views/DetailView.vue";
import CarView from "../views/CarView.vue";
import ChangePass from "../views/Changepass.vue";
import NotFound from "../views/NotFoundView.vue";
import FindPass from "../views/FindPassView.vue";
import CategoryList from "../views/GoodsCategory.vue";
import CategoryBrandproList from "../views/CategoryBrandproList.vue";
import Address from "../views/Address.vue";
import Order from "../views/Order.vue";

const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: "/",
      name: "home",
      components: {
        default: HomeView,
        header: HeaderComp,
        footer: FooterComp,
      },
    },
    {
      path: "/login",
      name: "login",
      component: LoginView,
    },
    {
      path: "/user",
      name: "user",
      component: UserCenterView,
    },
    {
      path: "/regist",
      name: "regist",
      component: RegistView,
    },
    {
      path: "/registtwo",
      name: "registtwo",
      component: RegistTwoComp,
    },
    {
      path: "/detail",
      name: "detail",
      component: DetailView,
    },
    {
      path: "/car",
      name: "car",
      component: CarView,
    },
    {
      path: "/changepass",
      name: "changepass",
      component: ChangePass,
    },
    {
      path: "/findpass",
      name: "findpass",
      component: FindPass,
    },
    {
      path: "/categoylist",
      name: "categoylist",
      component: CategoryList,
    },
    {
      path: "/categorybrandprolist",
      name: "categorybrandprolist",
      component: CategoryBrandproList,
    },
    {
      path: "/address",
      name: "address",
      component: Address,
    },
    {
      path: "/order",
      name: "order",
      component: Order,
    },
    {
      path: "/:pathMatch(.*)*",
      redirect: "/404",
      component: NotFound,
    },

    // {
    //   path: "/todolist",
    //   component: TodoList,
    // },
    // {
    //   path: "/CFB",
    //   component: Chengfabiao,
    // },
  ],
});

export default router;
